"use strict"

/**
 * 唐山市政府爬虫
 *  
 */


var Base = require("./base");
var ts_spider = new Base();
ts_spider.name = "唐山市政府采购网";

ts_spider.getPageUrl = function (pg) {
    var url = "http://www.tangshan.gov.cn/zhuzhan/zhaobiaogonggao/";
    if (pg != 1) {
        url = "http://www.tangshan.gov.cn/zhuzhan/zhaobiaogonggao/index_" + pg + ".html";
    }
    return url;
};

ts_spider.getItems = function ($) {
    var items = [];
    $(".open_list li a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.tangshan.gov.cn" + e.attr("href");
        item.source = ts_spider.name;
        items.push(item);

    });
    return items;
}

exports = module.exports = ts_spider;